<template>
  <div>
    <table class="table1 owntable mb20 tableLayout" border="0" cellspacing="0" cellpadding="1" width="100%">
      <tr>
        <td width="150">生产管理(中间品)编号</td>
        <td>{{ item.number }}</td>
        <td width="150">生产批号</td>
        <td>{{ item.batchNumber }}</td>
      </tr>
      <tr>
        <td>原材料批号</td>
        <td>{{ item.materialNumber }}</td>
        <td>生产日期</td>
        <td>{{ item.productionDate }}</td>
      </tr>
      <tr>
        <td>管理部门</td>
        <td>{{ item.manageDeptName }}</td>
        <td>负责人</td>
        <td>{{ item.manageUserName }}</td>
      </tr>
      <tr>
        <td>编制部门</td>
        <td colspan="3">{{ item.createDeptName }}</td>
      </tr>
    </table>

    <div class="mb20">中间品信息如下：</div>
    <table class="table1 owntable mb20 tableLayout" border="0" cellspacing="0" cellpadding="1" width="100%" v-for="(v, i) in item.middleList" :key="i">
      <tr>
        <td width="150">中间品名称</td>
        <td>{{ v.middleName }}</td>
        <td width="150">中间品规格型号</td>
        <td>{{ v.middleSku }}</td>
      </tr>
      <tr>
        <td>中间品编号</td>
        <td>{{ v.middleNumber }}</td>
        <td>中间品数量</td>
        <td>{{ v.middleQty }}{{ v.unit }}</td>
      </tr>
      <tr>
        <td>是否有特殊过程</td>
        <td colspan="3">{{ v.isProcess ==1 ? '是' : '否' }}</td>
      </tr>
      <tr v-if="v.processNamesList">
        <td :rowspan="v.processNamesList.length">特殊过程名称</td>
        <td colspan="3" class="flex_between white_bg" v-for="(m, i) in v.processNamesList" :key="i">
          <span>{{ m.name }}</span>
        </td>
      </tr>
      <tr v-if="v.gongxuList">
        <td :rowspan="v.gongxuList.length">生产工序</td>
        <td colspan="3" class="white_bg" v-for="(m, i) in v.gongxuList" :key="i">
          <div class="flex_between">
            <div>
              <span class="red_f">{{ m.number }}</span>
               <span class="ml10">{{ m.name }}</span>
            </div>
           <el-button size="mini"  plain @click="showItem(m)">查看</el-button>
          </div>
        </td>
      </tr>
    </table>
    <showgongxu ref="showgongxu"></showgongxu>
  </div>
</template>

<script>
import showgongxu from './showgongxu.vue';
export default {
  props: {
    item: {}
  },
  components: {
    showgongxu
  },
  methods: {
    showItem(item) {
      item.operateUserIdList=item.operateUserId && item.operateUserId.split(',');
      this.$refs.showgongxu.init(item);
    }
  }
};
</script>

<style></style>
